package com.tiancheng.trade.payment.service;

import com.tiancheng.trade.commom.core.data.Result;
import com.tiancheng.trade.commom.core.exception.BusinessException;
import com.tiancheng.trade.payment.channel.bo.PayResultBO;
import com.tiancheng.trade.payment.channel.bo.RefundResultBO;
import com.tiancheng.trade.payment.model.IntPaymentOrder;
import com.tiancheng.trade.payment.model.IntRefundFlow;
import com.tiancheng.trade.payment.vo.api.CloseOrderVO;
import com.tiancheng.trade.payment.vo.api.PaypalCreateReqVO;
import com.tiancheng.trade.payment.vo.api.PaypalExecuteReqVO;
import com.tiancheng.trade.payment.vo.api.PaypalRefundReqVO;
import com.tiancheng.trade.payment.vo.api.res.PaypalCreateResVO;
import com.tiancheng.trade.payment.vo.api.res.PaypalExecuteResVO;
import com.tiancheng.trade.payment.vo.api.res.PaypalQueryResVO;
import com.tiancheng.trade.payment.vo.api.res.PaypalRefundResVO;

public interface PaypalOrderService {


    /**
     * 创建支付
     * @param requestVO
     * @return
     */
    PaypalCreateResVO createPayment(PaypalCreateReqVO requestVO) ;

    /**
     * 确认支付
     * @return
     */
    PaypalExecuteResVO executePayment(PaypalExecuteReqVO reqVO) ;


    /**
     * 退款
     * @param paypalRefundVO
     * @return
     */
    PaypalRefundResVO refundOrder(PaypalRefundReqVO paypalRefundVO) ;

    /**
     * 处理支付回调结果
     * @param payResultBO
     * @return
     * @throws BusinessException
     */
    IntPaymentOrder payResult(PayResultBO payResultBO,String flag) throws BusinessException;

    /**
     * 关闭流水
     * @param orderVO
     * @return
     */
    Result closeOrder(CloseOrderVO orderVO);

    /**
     * 获取用户指定流水
     * @param flowId
     * @return
     */
    IntPaymentOrder getIntFlowInfo(String flowId);


    /**
     * 退款结果
     *
     * @param refundResultBO
     * @return
     * @throws BusinessException
     */
    IntRefundFlow refundResult(RefundResultBO refundResultBO,String flag) throws BusinessException;


    /**
     * 查询paypal支付信息
     * @param paymentId
     * @return
     */
    Result<PaypalQueryResVO> getPaypal(String paymentId) ;

}
